// 用户的store模块
// 每个模块都有自己的state/mutations/actions/getters
const state = {
  // 用户token信息
  tokenInfo: JSON.parse(localStorage.getItem('hm-82-hmtokenInfo')) || {}
}
const mutations = {
  // 将用户token存储在vuex中mutation
  setTokenInfo(state, tokenObj) {
    state.tokenInfo = tokenObj
    // 将token存储
    localStorage.setItem('hm-82-hmtokenInfo', JSON.stringify(tokenObj))
  }
}
const actions = {}
const getters = {}
export default {
  state,
  mutations,
  actions,
  getters,
  // 开启命名空间
  namespaced: true
}
